<?php
/*
 * @Author: 李志刚
 * @CopyRight: 2020-2030 衡水山木枝技术服务有限公司
 * @Date: 2021-07-05 17:53:39
 * @Description: 租户、门店的api
 * @LastEditors: 李志刚
 * @LastEditTime: 2021-09-30 15:34:31
 * @FilePath: /qingshanERP/routes/t-api.php
 */
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

// 管理中心API
Route::group(['prefix' => 't-api', 'namespace' => 'Tenant'], function () {
    // 登录
    Route::post('login', 'LoginController@postLogin');
});


Route::group(['prefix' => 't-api', 'namespace' => 'Tenant', 'middleware' => ['t-api']], function () {
    // 订单
    Route::group(['prefix' => 'order'], function () {
        Route::get('/pddlist', 'OrderPddController@getList');
        Route::post('/pddsupplier', 'OrderPddController@postSupplier');
        Route::post('/pddtrack', 'OrderPddController@postTrack');
        Route::post('/pddtrackm', 'OrderPddController@postTrackM');
        Route::post('/pddreissue', 'OrderPddController@reissueTrack');
        Route::post('/pddreissuenumber', 'OrderPddController@reissueTrackNumber');
        Route::post('/pddwaybill', 'OrderPddController@postWaybill');
        Route::post('/pddordertrack', 'OrderPddController@postOrderTrack');
        Route::post('/synctime', 'OrderPddController@postSyncTime');
    });
    // 商品同步
    Route::group(['prefix' =>'good', 'middleware' => ['t-super']], function () {
        Route::get('/list', 'GoodController@getList');
        Route::get('/speclist', 'GoodController@postSpecList');
        Route::post('/sync', 'GoodController@postSync');
        Route::get('/gnlist', 'GoodController@postGNList');
        Route::post('/gncreate', 'GoodController@postGNCreate');
        Route::post('/gndetail', 'GoodController@postGNDetail');
        Route::post('/gnedit', 'GoodController@postGNEdit');
        Route::post('/gnremove', 'GoodController@postGNRemove');
        Route::get('/snlist', 'GoodController@postSNList');
        Route::post('/sncreate', 'GoodController@postSNCreate');
        Route::post('/sndetail', 'GoodController@postSNDetail');
        Route::post('/snedit', 'GoodController@postSNEdit');
        Route::post('/snremove', 'GoodController@postSNRemove');
    });
    // 供应商管理
    Route::group(['prefix' => 'supplier'], function () {
        Route::get('/list', 'SupplierController@getList');
    });
    // 物流公司同步
    Route::group(['prefix' =>'logistics', 'middleware' => ['t-super']], function () {
        Route::get('/list', 'LogisticsController@getList');
        Route::post('/create', 'LogisticsController@postCreate');
        Route::post('/detail', 'LogisticsController@postDetail');
        Route::post('/edit', 'LogisticsController@postEdit');
        Route::post('/remove', 'LogisticsController@postRemove');
        Route::post('/syncpdd', 'LogisticsController@postSyncPdd');
        Route::post('/syncwaywill', 'LogisticsController@postSyncWaywill');
        Route::post('/synctemp', 'LogisticsController@postSyncTemp');
    });
    // 店铺管理
    Route::group(['prefix' =>'shop', 'middleware' => ['t-super']], function () {
        Route::get('/list', 'ShopController@getList');
        Route::post('/create', 'ShopController@postCreate');
        Route::post('/detail', 'ShopController@postDetail');
        Route::post('/edit', 'ShopController@postEdit');
        Route::post('/remove', 'ShopController@postRemove');
        Route::get('/relation', 'ShopController@getShopRelation');
        Route::post('/relation', 'ShopController@postShopRelation');
    });
    // 个人信息
    Route::group(['prefix' => 'tinfo'], function () {
        Route::post('/detail', 'TenantController@postDetail');
        Route::post('/info', 'TenantController@postInfo');
        Route::post('/pwd', 'TenantController@postPwd');
    });
    // 左侧菜单
    Route::get('menu/list', 'MenuController@getList');
    // 直接用正则控制所有错误请求到一个地址
    Route::pattern('path', '.+');
    Route::any('{path}', 'ResponseController@anyErrors');
});